#规格选项序列化器类
from rest_framework import serializers

from goods.models import SpecificationOption, SPUSpecification


class SPUSpecificationserializer(serializers.ModelSerializer):
    class Meta:
        model = SPUSpecification
        fields =('id', 'name')



class SpecificationOptionserializer(serializers.ModelSerializer):
    spec = SPUSpecificationserializer
    class Meta:
        model =SpecificationOption
        fields=('id','value','spec')